home *** CD-ROM | disk | FTP | other *** search
- /*
- * illustrate the use of memory and string routines
- *
- */
-
- #include <strings.h>
- #include <stdio.h>
-
- extern int bcmp ();
- extern void bzero ();
- extern void bcopy ();
-
- #define BUFFER 256
- char *string = "this is a test";
- char buf[BUFFER];
-
- main ()
- {
- int rv;
- char *cp;
-
- bzero (buf, BUFFER);
- bcopy (string, buf, strlen(string));
- rv = bcmp (string, buf, strlen(string));
- if ( rv == 0 )
- printf ("Copied strings match\n");
- cp = index (buf, 'a');
- if (cp != NULL)
- printf ("Found character in string\n");
-
- }
-